//
//  ViewController.m
//  LocalNotificatioon
//
//  Created by xalo on 16/4/26.
//  Copyright © 2016年 刘欢. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self sendNotification];
}

//发送推送
-(void)sendNotification{
    NSLog(@"123");
    //初始化本地推送
    UILocalNotification *local = [[UILocalNotification alloc]init];
    //推送时间
    local.fireDate = [NSDate dateWithTimeIntervalSinceNow:5];
    //推送标题
    local.alertTitle = @"alertTitle";
    //推送内容
    local.alertBody = @"厚德载物";
    //推送声音
    local.soundName = UILocalNotificationDefaultSoundName;
    //设置角标数
    local.applicationIconBadgeNumber = 1;
    //设置参数
    local.userInfo = @{@"name":@"小白"};
    //告诉系统我们要发送的推送
    [[UIApplication sharedApplication]scheduleLocalNotification:local ];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}















@end
